﻿using Cl.Model.Results;
using Cl.Service.Service.User.Roles;
using Cl.WebApi.Controllers;
using Cl.WebApi.SwaggerModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Cl.WebApi.Areas.Admin.Users
{
    /// <summary>
    /// 角色管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = Grouping.AdminGroup)]
    public class RoleController : BaseController
    {

        private IRoleService _roleService;

        /// <summary>
        /// 构造函数
        /// </summary>
        public RoleController(IRoleService roleService)
        {
            _roleService = roleService;
        }

        /// <summary>
        /// 获取角色列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResultInfoModel GetRoleList()
        {
            var data = _roleService.GetRoleList();
            return GetResult.Success("Success", data);

        }
    }
}
